Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: the 'smgropen' in the 'calculate_relation_size' function may return an incorrect 'smgrRelation' #518

Open
wants to merge 1 commit into
base: REL_16_STABLE_neon
Choose a base branch
from

Conversation

Lzjing-1997
Copy link

steps to reproduce:

postgres=# create table sa(a int) partition by range(a);
CREATE TABLE
postgres=# create unlogged table sb(b int) partition by range(b);
CREATE TABLE
postgres=# select pg_relation_size('sa'), pg_relation_size('sb');
ERROR: relpersistence mismatch: smgropen u vs SmgrRelation p

For a partitioned table, the relfilenode of its parent table is always 0 ; 'smgropen' in function 'calculate_relation_size' may get incorrect 'smgrRelation' due to 'SMgrRelationHash'.

@tristan957
Copy link
Member

I have created a team task for us to review your PR. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants